package cn.shoukaiseki.sjf4j.fastjson;

import cn.shoukaiseki.sjf4j.node.JsonNodeType;
import cn.shoukaiseki.sjf4j.node.TreeNode;
import com.alibaba.fastjson2.JSONArray;

public class FastjsonArrayNode extends FastjsonTreeNode<JSONArray> {

    public FastjsonArrayNode(JSONArray jsonNode) {
        super(jsonNode);
    }

    @Override
    public JsonNodeType getNodeType() {
        return JsonNodeType.ARRAY;
    }

    @Override
    public int size() {
        return value.size();
    }

    @Override
    public TreeNode get(String fieldName) {
        return null;
    }

    @Override
    public TreeNode get(int index) {
        if ((index >= 0) && (index < value.size())) {
            return convert(value.get(index));
        }
        return null;
    }

    @Override
    public boolean isShort() {
        return false;
    }

    @Override
    public boolean canConvertToInt() {
        return false;
    }

    @Override
    public int asInt() {
        return 0;
    }

    @Override
    public Integer asIntVal() {
        return null;
    }

    @Override
    public long asLong() {
        return 0;
    }

    @Override
    public Long asLongVal() {
        return null;
    }
}
